package com.zhengqing.design.action.memento._01;

import org.assertj.core.util.Lists;

import java.util.List;

/**
 * <p> 负责从 Memento 中恢复对象的状态 </p>
 *
 * @author zhengqingya
 * @description
 * @date 2022/12/22 11:21
 */
public class CareTaker {
    private List<Memento> mementoList = Lists.newArrayList();

    public void add(Memento state) {
        this.mementoList.add(state);
    }

    public Memento get(int index) {
        return this.mementoList.get(index);
    }
}